<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <title>美丽说-购物车页面</title>
    <link rel="stylesheet" href="/public/home/css/base.css" type="text/css" />
    <link rel="stylesheet" href="/public/home/css/shop_common.css" type="text/css" />
    <link rel="stylesheet" href="/public/home/css/shop_header.css" type="text/css" />
    <link rel="stylesheet" href="/public/home/css/shop_manager.css" type="text/css" />
    <link rel="stylesheet" href="/public/home/css/shop_form.css" type="text/css" />
    <link rel="icon" href="/public/home/images/7d026282ff00a259b6a7b90eee6d_48_48.c5.png" type="image/x-icon"/>
    <script type="text/javascript" src="/public/home/js/jquery.js"></script>
    <script type="text/javascript" src="/public/home/js/topNav.js"></script>
    

  <script type="text/javascript">
  jQuery(function(){
    jQuery("#new_add_shdz_btn").toggle(function(){
      jQuery("#new_add_shdz_contents").show(500);
    },function(){
      jQuery("#new_add_shdz_contents").hide(500);
    });
  });
  </script>
  </head>
  
  <body>
   <div class="shop_hd">
      <!-- Header TopNav -->
      <div class="shop_hd_topNav">
        <div class="shop_hd_topNav_all">
          <!-- Header TopNav Left -->
          @if(!session('id'))
          <div class="shop_hd_topNav_all_left">
            <p>您好，欢迎来到&nbsp;
              美丽说商城&nbsp;[
              <a href={{url('/login')}}>登录</a>]&nbsp;[
              <a href={{url('/register')}}>注册</a>]</p></div>
          @else
            <div class="shop_hd_topNav_all_left">
            <p><span style="color:red">{{session("username")}}</span>&nbsp;您好，欢迎来到&nbsp;
              美丽说商城&nbsp;[
              <a href={{url('/clear/clear')}}>退出</a>]&nbsp;</p></div>
          @endif
          <!-- Header TopNav Left End -->
          <!-- Header TopNav Right -->
          <div class="shop_hd_topNav_all_right">
            <ul class="topNav_quick_menu">
              <li>
                <div class="topNav_menu">
                  <a href="#" class="topNavHover">我的商城
                    <i></i>
                  </a>
                  <div class="topNav_menu_bd" style="display:none;">
                    <ul>
                      <li>
                        <a title="已买到的商品" target="_top" href="{{url('/order/orderlist')}}">已买到的商品</a></li>
                      <li>
                        <a title="个人主页" target="_top" href="{{url('/basics/basics')}}">个人主页</a></li>
                      <li>
                        <a title="我的好友" target="_top" href="#">我的好友</a></li>
                    </ul>
                  </div>
                </div>
              </li>
              <li>
                <div class="topNav_menu">
                  <a href="#" class="topNavHover">卖家中心
                    <i></i>
                  </a>
                  <div class="topNav_menu_bd" style="display:none;">
                    <ul>
                      <li>
                        <a title="已售出的商品" target="_top" href="#">已售出的商品</a></li>
                      <li>
                        <a title="销售中的商品" target="_top" href="#">销售中的商品</a></li>
                    </ul>
                  </div>
                </div>
              </li>
              <li>
                <div class="topNav_menu">
                  <a href="{{ url('/cart') }}" class="topNavHover">购物车</a>
                  <div class="topNav_menu_bd" style="display:none;">
                    <!-- <ul>
                    <li><a title="已售出的商品" target="_top" href="#">已售出的商品</a></li>
                    <li><a title="销售中的商品" target="_top" href="#">销售中的商品</a></li></ul>
                    -->
                    <p>还没有商品，赶快去挑选！</p>
                  </div>
                </div>
              </li>
              <li>
                <div class="topNav_menu">
                  <a href="#" class="topNavHover">我的收藏
                    <i></i>
                  </a>
                  <div class="topNav_menu_bd" style="display:none;">
                    <ul>
                      <li>
                        <a title="收藏的商品" target="_top" href="{{ url('/collection/index/1') }}">收藏的商品</a></li>
                      <li>
                        <a title="收藏的店铺" target="_top" href="{{ url('/collection/index/2') }}">收藏的店铺</a></li>
                    </ul>
                  </div>
                </div>
              </li>
              <li>
                <div class="topNav_menu">
                  <a href="#">站内消息</a></div>
              </li>
            </ul>
          </div>
          <!-- Header TopNav Right End --></div>
        <div class="clear"></div>
      </div>
      <div class="clear"></div>
      <!-- Header TopNav End -->
      <!-- TopHeader Center -->
      <div class="shop_hd_header">
        <div class="shop_hd_header_logo">
          <h1 class="logo">
            <a href="/">
              <img src="/public/home/images/logo.png" alt="ShopCZ" /></a>
            <span>ShopCZ</span></h1>
        </div>
        <div class="shop_hd_header_search">
          <ul class="shop_hd_header_search_tab">
            <li id="search" class="current">商品</li>
          </ul>
          <div class="clear"></div>
          <div class="search_form">
            <form method="get" action="{{url('/goodslist')}}">
              <div class="search_formstyle">
                <input type="text" class="search_form_text" name="goods_name" placeholder="请输入商品名称!" />
                <input type="submit" class="search_form_sub" name="secrch_submit" value="" title="搜索" /></div>
            </form>
          </div>
          <div class="clear"></div>
          <div class="search_tag">
            <a href="{{url('/goodslist?goods_name=裙子')}}">裙子</a>
            <a href="{{url('/goodslist?goods_name=上衣')}}">上衣</a>
            <a href="{{url('/goodslist?goods_name=连衣裙')}}">连衣裙</a>
            <a href="">化妆品</a>
            <a href="">手提包</a></div>
        </div>

      </div>
      <div class="clear"></div>
      <!-- TopHeader Center End -->
      <!-- Header Menu -->
      <div class="shop_hd_menu">
        <!-- 所有商品菜单 -->
        <div id="shop_hd_menu_all_category" class="shop_hd_menu_all_category"><!-- 首页去掉 id="shop_hd_menu_all_category" 加上clsss shop_hd_menu_hover -->
        <div class="shop_hd_menu_all_category_title"><h2 title="所有商品分类"><a href="javascript:void(0);">所有商品分类</a></h2><i></i></div>
        <div id="shop_hd_menu_all_category_hd" class="shop_hd_menu_all_category_hd">
          <ul class="shop_hd_menu_all_category_hd_menu clearfix">
            <!-- 菜单项 -->
            @foreach($menu as $k=>$v)
            <li id="cat_{{$k+1}}" class="">
              <h3><a href="{{ url('/goodslist?cate='.$v->id) }}" >{{ $v->name }}</a></h3>
              @if($v->sub)
              <div id="cat_1_menu" class="cat_menu clearfix" style="">
                @foreach($v->sub as $kk=>$vv)
                <dl class="clearfix">
                  <dt><a href="{{ url('/goodslist?cate='.$vv->id) }}" >{{ $vv->name }}</a></dt>
                  @if($vv->sub)
                  <dd>
                    @foreach($vv->sub as $kkk=>$vvv)
                    <a href="{{ url('/goodslist?cate='.$vvv->id) }}">{{ $vvv->name }}</a>
                    @endforeach
                  </dd>
                  @endif
                </dl>
                                @endforeach
              </div>
                            @endif
            </li>
            @endforeach
            <!-- 菜单项 End -->
          </ul>
        </div>
      </div>
        <!-- 所有商品菜单 END -->
        <!-- 普通导航菜单 -->
        <ul class="shop_hd_menu_nav">
          <li class="current_link">
            <a href="{{url('/')}}">
              <span>首页</span></a>
          </li>
          <li class="link">
            <a href="">
              <span>团购</span></a>
          </li>
          <li class="link">
            <a href="">
              <span>品牌</span></a>
          </li>
          <li class="link">
            <a href="">
              <span>优惠卷</span></a>
          </li>
          <li class="link">
            <a href="">
              <span>积分中心</span></a>
          </li>
          <li class="link">
            <a href="">
              <span>运动专场</span></a>
          </li>
          <li class="link">
            <a href="">
              <span>微商城</span></a>
          </li>
          <li class="link">
            <a href="{{ url('/community/index') }}">
              <span>社区</span></a>
          </li>
        </ul>
        <!-- 普通导航菜单 End --></div>
      <!-- Header Menu End --></div>
    <div class="clear"></div>
    <!-- 面包屑 注意首页没有 -->
    <div class="shop_hd_breadcrumb">
      <strong>当前位置：</strong>
      <span>
        <a href="{{url('/')}}">首页</a>&nbsp;›&nbsp;
        <a href="{{url('/')}}">我的商城</a>&nbsp;›&nbsp;
        <a href="{{url('/cart')}}">我的购物车</a></span>
    </div>
    <div class="clear"></div>
    <!-- 面包屑 End -->
    <!-- Header End -->
    <!-- 购物车 Body -->
   <div class="shop_member_bd clearfix">
    <!-- 左边导航 -->
    <div class="shop_member_bd_left clearfix">
        <div class="shop_member_bd_left_pic">
          <a href="javascript:void(0);">
            <img src="{{session('per_pic')}}" /></a>
        </div>
        <div class="clear"></div>
        <dl>
          <dt>我的交易</dt>
          <dd>
            <span>
              <a href="{{url('order/orderlist')}}">已购买商品</a></span>
          </dd>
          <dd>
            <span>
              <a href="{{url('collection/index/1')}}">我的收藏</a></span>
          </dd>
          <dd>
            <span>
              <a href="{{url('comment/index')}}">评价管理</a></span>
          </dd>
        </dl>
        <dl>
          <dt>我的账户</dt>
          <dd>
            <span>
              <a href="{{url('/basics/basics')}}">个人资料</a></span>
          </dd>
          <dd>
            <span>
              <a href="{{url('/person')}}">密码修改</a></span>
          </dd>
          <dd>
            <span>
              <a href="{{url('address/addrlist')}}">收货地址</a></span>
          </dd>
        </dl>
      </div>
    <!-- 左边导航 End -->
    
    <!-- 右边购物列表 -->
   <div class="shop_member_bd_right clearfix">
      
      <div class="shop_meber_bd_good_lists clearfix">
        <div class="title"><h3>编辑收货地址</h3></div>
        <div class="clear"></div>
        <dic class="shop_home_form">
          <form action="{{url('/address/addrupdate')}}" class="shop_form" method="post">
            <ul>
              <li style="width:790px"><label><span>*</span>收货人姓名：</label><input type="text" name="aname" class="form-text" value="{{$address->aname}}" style="width:500px;height:30px;"></li>
              <li style="width:790px"><label>所在地：</label>
                <script type="text/javascript" src="/public/home/location/jquery.js"></script>
                <script type="text/javascript" src="/public/home/location/area.js"></script>
                <script type="text/javascript" src="/public/home/location/location.js"></script>

                  <!--层级联动选择框-->
                <select id="loc_province" class="" name="sheng"  style="width:80px;height:30px;"></select>
                <select id="loc_city" class="" name="shi" style="width:100px;height:30px;"></select>
                <select id="loc_town" class="" name="xian" style="width:120px;height:30px;"></select>
              </li>
              <input type="hidden" name="id" value="{{$address->id}}" />
              <li style="width:790px"><label><span>*</span>详细地址：</label><input name="info" type="text" class="form-text" value="{{$address->info}}" style="width:500px;height:30px;"></li>
              <li style="width:790px"><label >邮编：</label><input type="text" name="posid" class="form-text" value="{{$address->posid}}" style="width:500px;height:30px;"></li>
              <li style="width:790px"><label>手机号：</label><input name="phone" type="text" class="form-text" value="{{$address->phone}}" style="width:500px;height:30px;"></li>
              <li class="bn"><label>&nbsp;</label><input type="submit" class="form-submit" value="保存修改"></li>
            </ul>
            {{ csrf_field() }}
          </form>
        </dic></div>
      </div>
    <!-- 右边购物列表 End -->

  </div>
    <!-- 购物车 Body End -->
    <!-- Footer - wll - 2013/3/24 -->
    <div class="clear"></div>
    <div class="shop_footer">
      <div class="shop_footer_link">
        <p>
          <a href="{{url('/')}}">首页</a>|
          <a href="">招聘英才</a>|
          <a href="">广告合作</a>|
          <a href="">关于ShopCZ</a>|
          <a href="">关于我们</a></p>
      </div>
      <div class="shop_footer_copy">
        <p>Copyright 2004-2013 itcast Inc.,All rights reserved.</p>
      </div>
    </div>
    <script type="text/javascript">
      $('#sub').click(function(){
         var aname = $('#aname').val();
        var phone = $('#phone').val();
        var sheng = $('#loc_province').val();
        var shi = $('#loc_city').val();
        var xian = $('#loc_town').val();
        var info = $('#info').val();
        var posid = $('#posid').val();
        
          // alert(aneme);
          $.get('/address/insert',{aname:aname,phone:phone,sheng:sheng,shi:shi,xian:xian,info:info,posid:posid},function(data){
            if(data == 1){
              // console.log(data);
              // alert('111');
              location.reload();
            }else{
              alert('添加失败');
            }
          })
      })




    </script>
    <script type="text/javascript">
      $(document).ready(function() {
        showLocation();

        $('.sheix').each(function(){
          var str = $(this).html();
          var info = getInfo(str);
          $(this).html(info);
        });

        //定义获取城市信息方法
        function getInfo(str){
          //console.log(str);
          //拆分字符串
          var arr = str.split(',');
          // console.log(arr);  
          var ls  = new Location;
          var l = ls.items;
          // console.log(l['0,1,2']['5']);
          var sheng = l['0'][arr[0]];
          var shi = l['0,'+arr[0]][arr[1]];
          var xian = l['0,'+arr[0]+','+arr[1]][arr[2]];
          return sheng+shi+xian;
        }

        //点击选中默认地址
        $('#addresses .item').each(function(){
          $(this).click(function(){
            //
            $('#addresses .item').removeClass('aa');  
            $(this).addClass('aa');
            //获取当前点击的地址id
            var id  = $(this).attr('aid');  
            $('input[name=address_id]').val(id);
          })
        })        
      });



  </script>

    <!-- Footer End --></body>

</html>